
/**
 * 
 */
package com.zsrt.day20170414.homework;


import java.util.Scanner;

import org.junit.Test;



/**
 * 实现类的测试
 * @author jmj
 * @date 2017年4月14日
 * @time 下午4:23:58
 */
public class MethodsImplTest {
	
	Methods result = new MethodsImpl();
	@Test
	public void methodsTest() throws Exception {
		int sum = result.add(10, 20);
		System.out.println(sum);
		
		int sub = result.sub(1, 20);
		System.out.println(sub);
		
		
		int cheng = result.multi(10, 20);
		System.out.println(cheng);
		
		
		int chu = result.div(10, 20);
		System.out.println(chu);
		
		int qiumo = result.mo(10, 20);
		System.out.println(qiumo);
		
		
	}
	
	/**
	 * 测试输入数字和符号得出结果
	 * @throws Exception
	 */
	@Test
	public void printInTest() throws Exception {
		
		
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入第一个数字：");
		int a =scanner.nextInt();
		System.out.println("请输入第二个数字：");
		int b = scanner.nextInt();
		
		System.out.println("请输入一个运算符号：");
		// 不能用nextline
		String x = scanner.next();
		
		
		int jg= result.printIn(a, b, x);
		System.out.println("结果="+jg);
		scanner.close();
	}

}
